<%@ Page language="c#" Inherits="Deepcode.Flux.Core.UI.AdministrationModulePage" %>
<%@ Register TagPrefix="Flux" Assembly="Deepcode.Flux.Core" Namespace="Deepcode.Flux.Core.UI.Controls" %>
<script runat="server">
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!Page.IsPostBack)
		{
			// Get and store the rootpath
			string rp = GetAttribute("rootpath", "");
			if (rp != "")
				Session["AssetRootPath"] = rp;
			else
			{
				Session["AssetRootPath"] = "";
				Session.Remove("AssetRootPath");
			}
			
			// Get and store the browse mode indicator
			string browsemode = GetAttribute("browse", "");
			if( browsemode != "" )
				Session["AssetBrowse"] = true;
			else
				Session["AssetBrowse"] = false;
            
            // Change the file masks
            string Masks = GetAttribute("masks", "");
            if( Masks != "" )
                this.SetUserSetting("ASSETFILEMASK", Masks);
		}
	}
</script>

<HTML>
<HEAD>
	<TITLE>Flux.NET ECMS</title>
	<LINK rel="stylesheet" type="text/css" href="../../Asset/Style/GeneralStyle.css"/>
	<script language="javascript">
	function loadEverything( xx )
	{
		loadFolders(xx);
		loadfiles(xx);
		loadActions(xx);
	}
	function loadfiles(vv)
	{
		var f = frames["FilesFrame"];
		if( f == null ) return;
		f.document.location.href = "files.aspx?path=" + vv;
		loadActions(vv);
	}
	function refreshFiles()
	{
		var f = frames["FilesFrame"];
		if( f == null ) return;
		f.reloadNow();
	}
	function loadFolders(vx)
	{
		var f = frames["FoldersFrame"];
		if( f == null ) return;
		f.document.location.href = "folders.aspx?selpath=" + vx;
	}
	function refreshFolders()
	{
		var f = frames["FoldersFrame"];
		if( f == null ) return;
		f.reloadNow();
	}
	function loadActions(vv)
	{
		var f = frames["ActionsFrame"];
		if( f == null ) return;
		f.document.location.href = "actions.aspx?path=" + vv;
	}
	function ReturnFile( vv )
	{
		if( window.parent )
		    if( window.parent.SetUrl != null )
		    {
		        window.parent.SetUrl( vv );
		        return;
		    }

		if( window.opener != null ) 
		{
			if( window.opener.AFU_SetValue != null )
				window.opener.AFU_SetValue('<%=Request["controlID"]%>', vv);
		}
		
        window.close();
	}
	</script>
	
</HEAD>
<body bgcolor="#f2f2f2">
<form runat="server" id="Form1">

<table width="100%" height="100%" cellspacing="5" cellpadding="0" border="0">
<tr>
	<td rowspan="2" width="250" height="100%">
		<Flux:FrameBox runat="server" width="250" height="100%" Title="Folders" url="folders.aspx" ID="Folders"/>
	</td>
	<td width="100%" height="100%">
		<Flux:FrameBox runat="server" width="100%" height="100%" Title="Files" url="files.aspx" ID="Files"/>
	</td>
</tr>
<tr><td height="150">
		<Flux:FrameBox runat="server" Width="100%" Height="150" Title="Actions" URL="actions.aspx" ID="Actions"/>
	</td>
</tr>
</table>
</form>
</body>
</HTML>